package com.itheima.web1.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;

/**
 * 实体类作为统一响应结果
 */
@Data
@AllArgsConstructor
public class Result {
    private Integer code;
    private String msg;
    private Object data;

    public static Result success(){
        return new Result(200,"success",null);
    }
    public static Result success(Object data){
        return new Result(200,"success",data);
    }
    public static Result error(String msg){
        return new Result(500,msg,null);
    }

}
